/**
 *@auther: tang
 *@Date: 2021-05-04
 *Project: hotwind-vue
 */
import goodsAny from "@/util/http";

export default {
    goodsAdd(data) {
        return new Promise(((resolve, reject) => {
            goodsAny({
                url: 'http://127.0.0.1:7001/hotwind/goods/goodsAdd',
                method: 'post',
                data,
            }).then(res => {
                resolve(res);
            }).catch(err => {
                reject(err);
            })
        }))
    },
    goodsQuery(data) {
        return new Promise(((resolve, reject) => {
            goodsAny({
                url: 'http://127.0.0.1:7001/hotwind/goods/goodsQuery',
                method: 'post',
                data,
            }).then(res => {
                resolve(res);
            }).catch(err => {
                reject(err);
            })
        }))
    },
    goodsUpdate(data) {
        return new Promise(((resolve, reject) => {
            goodsAny({
                url: 'http://127.0.0.1:7001/hotwind/goods/goodsUpdate',
                method: 'post',
                data,
            }).then(res => {
                resolve(res);
            }).catch(err => {
                reject(err);
            })
        }))
    },
    goodsDelete(data) {
        return new Promise(((resolve, reject) => {
            goodsAny({
                url: 'http://127.0.0.1:7001/hotwind/goods/goodsDelete',
                method: 'post',
                data,
            }).then(res => {
                resolve(res);
            }).catch(err => {
                reject(err);
            })
        }))
    }
}
